const int LED_Pin = 3;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  //625 - 476 = 149
  int value = analogRead(A0);
  int i = 0;
  if (value < 550) {//在有光状态 关闭
    for (i = i; i > -1; i -= 5) {
      analogWrite(LED_Pin, i);
    }
  } else {//在无光状态 打开
    for (i = i; i < 256; i += 5) {
      analogWrite(LED_Pin, i);
    }
  }
  delay(1000);
  Serial.println(value);
}
